<?php
namespace DesignModel\database;
/**
 * Created by PhpStorm.
 * User: 554665488
 * Date: 2018-6-19
 * Time: 17:43
 * @description:
 * @Author: yfl
 * @QQ 554665488
 */
class mysql implements Db
{
    protected $conn;

    public function connect($host, $user, $password, $db_name)
    {
        $conn = mysqli_connect($host, $user, $password);
        mysql_select_db($db_name, $conn);
        $this->conn = $conn;
    }

    public function query($query)
    {
        $res = mysqli_query($query, $this->conn);
        return $res;
    }

    public function close()
    {
        mysql_close($this->conn);
    }
}